﻿@{ ViewBag.Title = "数据回写记录";
    Layout = "~/Areas/Shared/_LayuiList.cshtml"; }

<input style="display: none" id="id" value="@ViewBag.id">
<table class="layui-hide" id="tableId" lay-filter="tableFilter"></table>

<script src="~/lib/layui/layui.js" charset="utf-8"></script>
<script>
    layui.use(["table", "form", "exLayer", "exUtils"], function () {
        let table = layui.table;
        let form = layui.form;
        let exLayer = layui.exLayer;
        let exUtils = layui.exUtils;
        let $ = layui.$;

        let ThisTable = table.render({
            elem: "#tableId",
            url: "/SysTable/TbRelation/GetWriteRecordList?id=" + $("#id").val(),
            limits: [10, 50, 200],
            limit: 10,
            page: true,
            defaultToolbar: [{ title: '刷新', layEvent: 'refresh', icon: 'layui-bg-gray layui-icon-refresh' }, 'filter', 'exports'],
            toolbar: "#toolbarTpl",
            cols: [[
                { field: "NumTimes", title: "NumTimes", width: 60, sort: true },
                { field: "WriteTime", title: "WriteTime", width: 150, sort: true },
                { field: "PrcsId", title: "PrcsId", width: 60, sort: true },
                { field: "FromTbId", title: "FromTbId", width: 90, sort: true },
                { field: "WriteTbId", title: "WriteTbId", width: 90, sort: true },
                { field: "FromId", title: "FromId", width: 90, sort: true },
                { field: "WriteId", title: "WriteId", width: 90, sort: true },
                { field: "strSql", title: "strSql", width: 300, sort: true },

                { field: "StrErr", title: "StrErr", sort: true }
            ]],
            done: function (res, curr, count) {
                console.log(res, curr, count);
            }
        });

        table.on("toolbar(tableFilter)", function (obj) {
            switch (obj.event) {
                case "refresh":
                    refresh();
                    break;
            }
        });

        function refresh() {
            ThisTable.reload({
                url: "/SysTable/TbRelation/GetWriteRecordList?id=" + $("#id").val(),
            });
        }
    });
</script>

<script type="text/html" id="toolbarTpl">
</script>